package ua.com.fesvlast.hotel.model.connectionpool;

import java.sql.Connection;

public abstract class ConnectionManager {
	private static ConnectionPool pool;
	private static Connection conn;
	

	public static Connection getConnection(){
		
		if(pool==null){
			pool=ConnectionPool.getConnPool();
		}
		if(conn==null){
			conn =pool.getConnection();
		}
		return conn;
	}
	
	public static void releaseConnection(Connection conn){
		ConnectionPool.getConnPool().releaseConnection(conn);
	}

}
